<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Echarts初识</title>
    <style>
        /*将容器设置背景颜色：引入图表做好衬托*/
        #container{
        width: 800px;
        height: 800px;
        background: #BDFCC9;
        margin: auto;
        }
    </style>
    <!-- 1.引入echarts.js文件-->
    <script src="js/echarts.js"></script>
</head>
<body>
<!--2.添加一个可以设置高宽的DOM容器(div空间--容器)-->
<div id="container" ></div>
<!-- 3.创建并且实例化Echarts对象  DOM树：爬取21种-->
<script>
    var myInit=echarts.init(document.querySelector("#container"))
    //4.指定配置项跟数据---不会啊（粘贴）先不解释
    option = {
  title: {
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};




    //5.将配置项设置给echarts实例对象
    myInit.setOption(option)
</script>
</body>
</html>